//
//  Fraction.h
//  OC03_属性
//
//  Created by dllo on 15/12/2.
//  Copyright © 2015年 dllo. All rights reserved.
//

#import <Foundation/Foundation.h>

@interface Fraction : NSObject

@property (nonatomic, assign)NSInteger numerator;
@property (nonatomic, assign)NSInteger denominator;

- (instancetype)initWithNumerator:(NSInteger)numerator
                      denominator:(NSInteger)denominator;


+ (instancetype)fractionWithNumerator:(NSInteger)numerator
                          denominator:(NSInteger)denominator;



/** 加法 */
- (Fraction *)addOperationWithFraction:(Fraction *)fraction;

/** 减法 */
- (Fraction *)subtractionOperationWithFraction:(Fraction *)fraction;

/** 乘法 */
- (Fraction *)multiplicationOperationWithFraction:(Fraction *)fraction;

/** 除法 */
- (Fraction *)divisionOperationWithFraction:(Fraction *)fraction;

/** 约分 */
- (void)reduce;

/** 比较两个分数的大小 */
- (NSComparisonResult)compareWithFraction:(Fraction *)frac;












@end
